﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Elysium.Controls;
using Elysium.Demo.Configuracion.Empresa;
using Elysium.Demo.Ventas.Transacciones;
using SIIE_ERP.Codigo;

namespace Elysium.Demo.Ventas
{
    /// <summary>
    /// Lógica de interacción para Menu_Configuracion.xaml
    /// </summary>
    public partial class Menu_Ventas : UserControl
    {
        private UsuarioActivo _sesion;

        public Menu_Ventas(ref UsuarioActivo usuario)
        {            
            InitializeComponent();
            this._sesion = usuario;
        }

        private void Expander_Catalogos_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Transacciones != null)
                Expander_Transacciones.IsExpanded = false;
            if (Expander_Arrendamiento != null)
                Expander_Arrendamiento.IsExpanded = false;
            if (Expander_Honorarios != null)
                Expander_Honorarios.IsExpanded = false;
        }

        private void Expander_Transacciones_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Catalogos != null)
                Expander_Catalogos.IsExpanded = false;
            if (Expander_Arrendamiento != null)
                Expander_Arrendamiento.IsExpanded = false;
            if (Expander_Honorarios != null)
                Expander_Honorarios.IsExpanded = false;
        }

        private void Expander_Honorarios_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Catalogos != null)
                Expander_Catalogos.IsExpanded = false;
            if (Expander_Transacciones != null)
                Expander_Transacciones.IsExpanded = false;
            if (Expander_Arrendamiento != null)
                Expander_Arrendamiento.IsExpanded = false;
        }

        private void Expander_Arrendamiento_Expanded(object sender, RoutedEventArgs e)
        {
            if (Expander_Catalogos != null)
                Expander_Catalogos.IsExpanded = false;
            if (Expander_Transacciones != null)
                Expander_Transacciones.IsExpanded = false;
            if (Expander_Honorarios != null)
                Expander_Honorarios.IsExpanded = false;
        }

        private void ButtonInmuebles_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Arrendamiento.Inmuebles_Consulta(ref _sesion);
        }

        private void ButtonClientes_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Catalogos.Clientes_Consulta(ref _sesion);
        }

        private void ButtonGrupoClientes_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Catalogos.GrupoClientes_Consulta(ref _sesion);
        }

        private void Button_NotasCredito_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.NotaCredito_Consulta(ref _sesion);
        }

        private void Button_Devoluciones_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.Devolucion_Consulta(ref _sesion);
        }

        private void Button_Facturas_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.Factura_Consulta(ref _sesion);
        }

        private void Button_Remisiones_Click_1(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.Remision_Consulta(ref _sesion);
        }

        private void Button_Pedidos_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.Pedido_Consulta(ref _sesion);
        }

        private void ButtonCotizaciones_Click(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Transacciones.Cotizacion_Consulta(ref _sesion);
        }

        private void ButtonHonorarios_Click_1(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Elysium.Demo.Ventas.Honorarios.ReciboHonorarios_Consulta(ref _sesion);
        }

        private void ButtonArrendamiento_Click_1(object sender, RoutedEventArgs e)
        {
            ScrollViewVentas.Content = new Elysium.Demo.Ventas.Arrendamiento.ReciboArrendamiento_Consulta(ref _sesion);
        }
    }
}
